## DESCRIPTION
## Formula answer with domain issues template
## ENDDESCRIPTION

## KEYWORDS('formula answer', 'template')

## DBsubject('WeBWorK')
## DBchapter('WeBWorK Tutorial')
## DBsection('Fort Lewis Tutorial 2011')
## Date('01/30/2011')
## Author('Paul Pearson')
## Institution('Fort Lewis College')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')


###########################
#  Initialization

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"answerHints.pl",
);

TEXT(beginproblem());


###########################
#  Setup

Context("Numeric");

$a = random(2,5,1);

$answer1 = Compute("sqrt(x-$a)");
$answer1->{limits} = [$a+1,$a+4];

$answer2 = Compute("ln(abs( x / (x-$a) ))");
$answer2->{test_points} = [[-5],[-4],[1],[$a-1],[7],[8]];


###########################
#  Main text

Context()->texStrings;
BEGIN_TEXT
(a) Suppose the first answer is 
\( \displaystyle $answer1 \).
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("formulas") \}
$BR
$BR
(b) Suppose the second answer is 
\( \displaystyle $answer2 \)
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("formulas") \}
END_TEXT
Context()->normalStrings;


############################
#  Answer evaluation

$showPartialCorrectAnswers = 1;

ANS( $answer1->cmp() );

ANS( $answer2->cmp()
->withPostFilter(AnswerHints(
  [Compute("ln(x/(x-$a))"),Compute("ln(x)-ln(x-$a)")] => 
  "Don't forget to use absolute value",
)) 
);


############################
#  Solution

Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();
